package com.dao.qsl;

import com.util.qsl.Dbutil;
import org.springframework.stereotype.Repository;

import java.sql.Connection;
import java.sql.PreparedStatement;

@Repository
public class AddXx {
      public Boolean tianjia(String fwmc,String xqmc,String fwsl,String kssj,String jssj){

	  if(fwmc==""||xqmc==""||fwsl==""||kssj==""||jssj==""){
	        return false;
	  }

	  Dbutil d=new Dbutil();

	  Connection c=null;

	  try {
	        c=d.getConnection();
	        String sql="INSERT INTO  service VALUES(null,?,?,0,?,?,?)";
	        PreparedStatement pr=c.prepareStatement(sql);

	        pr.setString(1,fwmc);
	        pr.setString(2,xqmc);
	        pr.setString(3,fwsl);
	        pr.setString(4,kssj);
	        pr.setString(5,jssj);

	        int i=pr.executeUpdate();

	        if(i>0){
		    return true;
	        }else{
		    return false;
	        }

	  }catch(Exception e){
	        e.printStackTrace();
	  }
		return  false;
      }
}
